#include <cstdio>
#include <vector>
#include <algorithm>
#include <auto_ptr.h>
using namespace std;

template< typename Iterator, typename Func >
void MergeSort( Iterator begin, Iterator end, Func merge )
{
	if( end == begin + 1 ) return;
	Iterator mid = begin + ( end - begin ) / 2;
	
	MergeSort( begin, mid, merge );
	MergeSort( mid, end, merge );
	
	merge( begin, end, mid );
}

template< typename Iter >
void Merge1( Iter begin, Iter end, Iter mid )
{
	typedef typename iterator_traits<Iter>::value_type ValueType;
	
	ValueType* tmp = new ValueType[ end - begin ];
	Iter pt = tmp;
	Iter p1 = begin;
	Iter p2 = mid;
	
	while( p1 < mid && p2 < end ) *(pt++) = (*p1 <= *p2) ? (*p1++) : (*p2++);
	while( p1 < mid ) *(pt++) = *(p1++);
	while( p2 < end ) *(pt++) = *(p2++);

	copy( tmp, tmp + end - begin, begin );
}

template< typename Iter >
void Merge2( Iter begin, Iter end, Iter mid )
{
	Iter p1 = begin;
	Iter p2 = mid;
	while( p1 < mid && p2 < end )
	{
		while( *p1 < *p2 ) p1++;
		Iter t = p2;
		while( *t < *p1 && t < end ) t++;
		if( t != p2 )
		{
			reverse( p1, p2 );
			reverse( p2, t );
			reverse( p1, t );
			p1 += ( t - p2 );
			p2 = t;
		}
	}
}


class Merge3
{

public:
template< typename Iter >
void operator()(Iter begin, Iter end, Iter mid)
	{	// apply operator> to operands
	
		typedef typename iterator_traits<Iter>::value_type ValueType;		
		Iter p1_begin = begin, p1 = begin;
		Iter p2_begin = mid, p2_end = end, p2 = mid;
		
		while( p1_begin < p2_begin && p2_begin < p2_end )
		{
			if( *p1 <= *p2 )
			{
				ValueType value = *p1;
				for( Iter j = p1 - 1; j >= p1_begin; j-- ) *(j + 1) = *j;
				*p1_begin = value;
				p1_begin++;
				p1++;
				if( p1 == p2_begin ) p1 = p1_begin;
			}
			else
			{
				swap( *p1_begin, *p2 );
				p1_begin++;
				if( p1 < p1_begin ) p1 = p2;
				p2++;
				p2_begin++;
			}
		}
		
		if( p1 != p1_begin && p1 < p2_begin )
		{
			reverse( p1_begin, p1 );
			reverse( p1, p2_begin );
			reverse( p1_begin, p2_begin );
		}
	}
};		

int main()
{
	size_t n = 0;
	scanf( "%d", &n );
	//vector<int> seq( n, 0 );
	int* seq = new int[n];
	for( size_t i = 0; i < n; i++ )
	{
		scanf( "%d", &seq[i] );
	}
	
	MergeSort( seq, seq + n, Merge3() );
	
	for( size_t i = 0; i < n; i++ )
	{
		printf( "%d ", seq[i] );
	}
	printf( "\n" );
	delete[] seq;
	return 0;
}